package com.hualan.domain;

import java.io.Serializable;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

/**
 * 心理测评表，用于存储心理测评基本信息
 * @TableName heartmark
 */
@Data
public class Heartmark implements Serializable {
    /**
     * 编号，主键自增
     */
    private Long id;

    /**
     * 评测名
     */
    private String name;

    /**
     * 简介
     */
    private String simplyintroduce;

    /**
     * 评测图片URL
     */
    private String picture;

    /**
     * 题目数量
     */
    private Integer total;
    private MultipartFile file;

    private static final long serialVersionUID = 1L;

    public Heartmark() {
    }

    public Heartmark(Long id, String name, String simplyintroduce, String picture, Integer total) {
        this.id = id;
        this.name = name;
        this.simplyintroduce = simplyintroduce;
        this.picture = picture;
        this.total = total;
    }

    public Heartmark(Long id, String name, String simplyintroduce, String picture, Integer total, MultipartFile file) {
        this.id = id;
        this.name = name;
        this.simplyintroduce = simplyintroduce;
        this.picture = picture;
        this.total = total;
        this.file = file;
    }

    public Heartmark(String name, String simplyintroduce, String picture, Integer total) {
        this.name = name;
        this.simplyintroduce = simplyintroduce;
        this.picture = picture;
        this.total = total;
    }

    public Heartmark(String name, String simplyintroduce, String picture, MultipartFile file) {
        this.name = name;
        this.simplyintroduce = simplyintroduce;
        this.picture = picture;
        this.file = file;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Heartmark other = (Heartmark) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getSimplyintroduce() == null ? other.getSimplyintroduce() == null : this.getSimplyintroduce().equals(other.getSimplyintroduce()))
            && (this.getPicture() == null ? other.getPicture() == null : this.getPicture().equals(other.getPicture()))
            && (this.getTotal() == null ? other.getTotal() == null : this.getTotal().equals(other.getTotal()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getSimplyintroduce() == null) ? 0 : getSimplyintroduce().hashCode());
        result = prime * result + ((getPicture() == null) ? 0 : getPicture().hashCode());
        result = prime * result + ((getTotal() == null) ? 0 : getTotal().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", simplyintroduce=").append(simplyintroduce);
        sb.append(", picture=").append(picture);
        sb.append(", total=").append(total);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}